<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>Parts Api Documentation</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <link href="help/css/bootstrap.css" rel="stylesheet">
    <link href="help/css/custom.css" rel="stylesheet">
    <link href="help/css/prettify.css" rel="stylesheet">
    <link href="help/css/bootstrap-responsive.css" rel="stylesheet">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="help/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="help/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="help/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="help/ico/apple-touch-icon-57-precomposed.png">
    <link rel="shortcut icon" href="help/ico/favicon.png">
    <style type="text/css"></style>
</head>

<body>

<div class="container-narrow">
    <h3 class="page-header">Parts Api Documentation</h3>

    <div class="hero-unit">
        <h1>Super awesome documentation!</h1>
    </div>

    <hr>

<div>
<ul id="actionTab" class="nav nav-tabs">
<li class="active"><a href="#user" data-toggle="tab">User</a></li>
<li class=""><a href="#playlist" data-toggle="tab">Playlist</a></li>
<li class=""><a href="#player" data-toggle="tab">Player</a></li>
<li class=""><a href="#device" data-toggle="tab">Device</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="user">
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">Login</span></p>
            <p>Description: <span class="label label-info"></span></p>
            <p>Permissions: <span class="label label-info">No permissions required</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>Login</td>
                </tr>
                <tr>
                    <td>userName</td>
                    <td>String</td>
                    <td></td>
                </tr>
                <tr>
                    <td>passHash</td>
                    <td>String</td>
                    <td>SHA512HEX Hash of the user password</td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : Login
userName : 
passHash : 
}</pre>
            <h3>Responses:</h3>
            <h4></h4>
                    <pre>{
type : OK
sessionId : 
}</pre>
            <h4></h4>
                    <pre>{
type : Error
message.key : 
message : 
}</pre>
        </div>
    </div>
</div>
<div class="tab-pane fade" id="playlist">
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">AddSongToPlaylist</span></p>
            <p>Description: <span class="label label-info"></span></p>
            <p>Permissions: <span class="label label-info">MODIFY_PLAYLIST</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>AddSongToPlaylist</td>
                </tr>
                <tr>
                    <td>songId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
                <tr>
                    <td>playlistId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : AddSongToPlaylist
songId : 
playlistId : 
}</pre>
            <h3>Responses:</h3>
            <h4></h4>
                    <pre>{
type : OK
}</pre>
            <h4></h4>
                    <pre>{
type : Error
message.key : 
message : 
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">CreatePlaylist</span></p>
            <p>Description: <span class="label label-info"></span></p>
            <p>Permissions: <span class="label label-info">CREATE_PLAYLIST</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>CreatePlaylist</td>
                </tr>
                <tr>
                    <td>name</td>
                    <td>String</td>
                    <td></td>
                </tr>
                <tr>
                    <td>createGlobal</td>
                    <td>Boolean</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : CreatePlaylist
name : 
createGlobal : 
}</pre>
            <h3>Responses:</h3>
            <h4></h4>
                    <pre>{
type : OK
playlistId : 
}</pre>
            <h4></h4>
                    <pre>{
type : Error
message.key : 
message : 
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">GetAllPlaylists</span></p>
            <p>Description: <span class="label label-info"></span></p>
            <p>Permissions: <span class="label label-info">READ_PLAYLISTS</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>GetAllPlaylists</td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : GetAllPlaylists
}</pre>
            <h3>Responses:</h3>
            <h4></h4>
                    <pre>{
type : OK
playlists : 
}</pre>
            <h4></h4>
                    <pre>{
type : Error
message.key : 
message : 
}</pre>
        </div>
    </div>
</div>
<div class="tab-pane fade" id="player">
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">DeletePlayer</span></p>
            <p>Description: <span class="label label-info">Delete a player</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>DeletePlayer</td>
                </tr>
                <tr>
                    <td>playerId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : DeletePlayer
playerId : 62536
}</pre>
            <h3>Responses:</h3>
            <h4>Response if deletion was successful</h4>
                    <pre>{
type : OK
}</pre>
            <h4>Response if deletion was not successful</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">GetPlayerInfo</span></p>
            <p>Description: <span class="label label-info">Get the info object for the given player</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>GetPlayerInfo</td>
                </tr>
                <tr>
                    <td>playerId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : GetPlayerInfo
playerId : 1231234
}</pre>
            <h3>Responses:</h3>
            <h4>Response if creation was successful</h4>
                    <pre>{
type : OK
playerInfo : {"connectedDevices":"[{"oid":"3,"ip":127.0.0.1,"name":"DeviceName"}],"name":"Playername","currentSong":,"currentPlaylist":,"currentPosition":-1.0,"currentState":"STOPPED"}
}</pre>
            <h4>Response if player-id is wrong</h4>
                    <pre>{
type : Error
message.key : InvalidId
message : Player with given id not found
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">GetAllPlayers</span></p>
            <p>Description: <span class="label label-info">List all available Players</span></p>
            <p>Permissions: <span class="label label-info">READ_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>GetAllPlayers</td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : GetAllPlayers
}</pre>
            <h3>Responses:</h3>
            <h4>Returns a List of all available Players</h4>
                    <pre>{
type : OK
players : 
}</pre>
            <h4>Returns the reason if anything went wrong</h4>
                    <pre>{
type : Error
message.key : 
message : 
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">CreatePlayer</span></p>
            <p>Description: <span class="label label-info">Create a new player</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>CreatePlayer</td>
                </tr>
                <tr>
                    <td>playerName</td>
                    <td>String</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : CreatePlayer
playerName : new_player
}</pre>
            <h3>Responses:</h3>
            <h4>Response if creation was successful</h4>
                    <pre>{
type : OK
playerId : 273645
}</pre>
            <h4>Error response</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">EditPlayer</span></p>
            <p>Description: <span class="label label-info">Rename a player</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>EditPlayer</td>
                </tr>
                <tr>
                    <td>playerId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
                <tr>
                    <td>name</td>
                    <td>String</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : EditPlayer
playerId : 24627
name : new_name
}</pre>
            <h3>Responses:</h3>
            <h4>Response if update was successful</h4>
                    <pre>{
type : OK
}</pre>
            <h4>Response if update was not successful</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
</div>
<div class="tab-pane fade" id="device">
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">GetAllDevices</span></p>
            <p>Description: <span class="label label-info">Returns all registered devices.</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_DEVICES</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>GetAllDevices</td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : GetAllDevices
}</pre>
            <h3>Responses:</h3>
            <h4>All registered devices</h4>
                    <pre>{
type : OK
devices : 
}</pre>
            <h4>Returns the error when occurred</h4>
                    <pre>{
type : Error
message.key : 
message : 
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">DeleteDevice</span></p>
            <p>Description: <span class="label label-info">Deletes a device with the given id.</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_DEVICES</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>DeleteDevice</td>
                </tr>
                <tr>
                    <td>deviceId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : DeleteDevice
deviceId : 1244
}</pre>
            <h3>Responses:</h3>
            <h4>Response if deletion was successful</h4>
                    <pre>{
type : OK
}</pre>
            <h4>Response if device-id is wrong</h4>
                    <pre>{
type : Error
message.key : InvalidId
message : Device with given id not found
}</pre>
            <h4>Response if deletion was not successful</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">ConnectDevice</span></p>
            <p>Description: <span class="label label-info">Connects a device with the player.
        If the device is already connected to another player it will be disconnected first.</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>ConnectDevice</td>
                </tr>
                <tr>
                    <td>name</td>
                    <td>String</td>
                    <td></td>
                </tr>
                <tr>
                    <td>playerId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
                <tr>
                    <td>deviceId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : ConnectDevice
name : Devicename
playerId : 24627
deviceId : 876521
}</pre>
            <h3>Responses:</h3>
            <h4>Response if connecting was successful</h4>
                    <pre>{
type : OK
}</pre>
            <h4>Response if player-id is wrong</h4>
                    <pre>{
type : Error
message.key : InvalidId
message : Player with given id not found
}</pre>
            <h4>Response if device-id is wrong</h4>
                    <pre>{
type : Error
message.key : InvalidId
message : Device with given id not found
}</pre>
            <h4>Response if device is already connected to this player</h4>
                    <pre>{
type : Error
message.key : Duplication
message : Device already connected to the given player
}</pre>
            <h4>Response if connecting was not successful</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">DisconnectDevice</span></p>
            <p>Description: <span class="label label-info">Disconnects a device from the player.</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_PLAYER</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>DisconnectDevice</td>
                </tr>
                <tr>
                    <td>playerId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
                <tr>
                    <td>deviceId</td>
                    <td>Long</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : DisconnectDevice
playerId : 24627
deviceId : 876521
}</pre>
            <h3>Responses:</h3>
            <h4>Response if disconnection was successful</h4>
                    <pre>{
type : OK
}</pre>
            <h4>Response if player-id is wrong</h4>
                    <pre>{
type : Error
message.key : InvalidId
message : Player with given id not found
}</pre>
            <h4>Response if device-id is wrong</h4>
                    <pre>{
type : Error
message.key : InvalidId
message : Device with given id not found
}</pre>
            <h4>Response if device was never connected to this player</h4>
                    <pre>{
type : Error
message.key : NoConnection
message : Device was never connected to the given player
}</pre>
            <h4>Response if disconnection was not successful</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <h2>Action</h2>
            <p>Name: <span class="label label-info">CreateDevice</span></p>
            <p>Description: <span class="label label-info">Creates a new device with the given name.</span></p>
            <p>Permissions: <span class="label label-info">MANAGE_DEVICES</span></p>
            Parameters:
            <table class="table table-bordered table-hover table-striped">
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Values</th>
                </tr>
                <tr>
                    <td>actionName</td>
                    <td>String</td>
                    <td>CreateDevice</td>
                </tr>
                <tr>
                    <td>name</td>
                    <td>String</td>
                    <td></td>
                </tr>
            </table>
            <h3>Request:</h3>
                    <pre>{
actionName : CreateDevice
name : Devicename
}</pre>
            <h3>Responses:</h3>
            <h4>Response if creation was successful</h4>
                    <pre>{
type : OK
deviceId : 
}</pre>
            <h4>Response if creation was not successful</h4>
                    <pre>{
type : Error
message.key : a error key
message : The reason which led to the error
}</pre>
        </div>
    </div>
</div>
</div>
</div>
</div>
<script src="./help/js/jquery.js"></script>
<script src="./help/js/bootstrap.js"></script>
<script src="./help/js/prettify.js"></script>
<script src="./help/js/run_prettify.js"></script>
</body>
</html>
